<?php
namespace Mouta\AdminBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Mouta\AmistateBundle\Entity\Denuncia;

class DenunciaAdmin extends Admin
{
    protected function configureFormFields(FormMapper $formMapper)
    {
		
        $formMapper
            ->add('motivo','choice', array('choices' => Denuncia::getMotivos()  ))
            ->add('mensaje')
            ->add('tipo','choice', array('choices' => Denuncia::getOpcionesTipo()  ))
			->add('created')
			->add('extra')
        ;
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('motivo')
            ->add('mensaje')
            ->add('tipo')
			->add('created')
			->add('denunciante','doctrine_orm_number')
			->add('infractor','doctrine_orm_number')
			->add('extra')
        ;
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('id')
            ->add('motivo')
            ->add('mensaje')
            ->add('tipo')
			->add('created')
			->add('denunciante')
			->add('infractor')
			->add('extra')
        ;
    }
	
}